<app-info-row
  *ngFor="let column of columns[fields.AuditConfig]; let rowIndex = index"
  [ifEdit]="isEdits[fields.AuditConfig][rowIndex]"
  [columns]="column"
  (active)="activeItem($event, rowIndex)"
  [rowIndex]="rowIndex"
></app-info-row>
<div class="cil__scroll-div"></div>

<ng-template #tplSwitchAudit let-column="column">
  <nz-switch
    [(ngModel)]="column.value"
    [nzCheckedChildren]="'GENERAL.INFO.SWITCH.ON' | i18n"
    [nzUnCheckedChildren]="'GENERAL.INFO.SWITCH.OFF' | i18n"
    (ngModelChange)="onChangeMainAudit($event)"
  ></nz-switch>
</ng-template>

<!-- 暂时隐藏
<ng-template #tplExchange let-column="column">
  <nz-switch class="audit" [(ngModel)]="swAuditStatus[auditConfigType.ExchangeRate]" [nzCheckedChildren]="'GENERAL.INFO.SWITCH.ON' | i18n"
    [nzUnCheckedChildren]="'GENERAL.INFO.SWITCH.OFF' | i18n"></nz-switch>
  <nz-select class="select" [(ngModel)]="column.value" [hidden]="!swAuditStatus[auditConfigType.ExchangeRate]">
    <nz-option *ngFor="let number of stepRange" [nzLabel]="number" [nzValue]="number">
      {{ number }}
    </nz-option>
  </nz-select>
</ng-template>
-->

<ng-template #tplOperation let-column="column">
  <nz-switch
    class="audit"
    [(ngModel)]="swAuditStatus[auditConfigType.Operation]"
    [nzCheckedChildren]="'GENERAL.INFO.SWITCH.ON' | i18n"
    [nzUnCheckedChildren]="'GENERAL.INFO.SWITCH.OFF' | i18n"
  ></nz-switch>
  <nz-select class="select" [(ngModel)]="column.value" [hidden]="!swAuditStatus[auditConfigType.Operation]">
    <nz-option *ngFor="let number of stepRange" [nzLabel]="number" [nzValue]="number">
      {{ number }}
    </nz-option>
  </nz-select>
</ng-template>

<ng-template #tplRiskControl let-column="column">
  <nz-switch
    class="audit"
    [(ngModel)]="swAuditStatus[auditConfigType.RiskControl]"
    [nzCheckedChildren]="'GENERAL.INFO.SWITCH.ON' | i18n"
    [nzUnCheckedChildren]="'GENERAL.INFO.SWITCH.OFF' | i18n"
  ></nz-switch>
  <nz-select class="select" [(ngModel)]="column.value" [hidden]="!swAuditStatus[auditConfigType.RiskControl]">
    <nz-option *ngFor="let number of stepRange" [nzLabel]="number" [nzValue]="number">
      {{ number }}
    </nz-option>
  </nz-select>
</ng-template>

<ng-template #tplStore let-column="column">
  <nz-switch
    class="audit"
    [(ngModel)]="swAuditStatus[auditConfigType.Store]"
    [nzCheckedChildren]="'GENERAL.INFO.SWITCH.ON' | i18n"
    [nzUnCheckedChildren]="'GENERAL.INFO.SWITCH.OFF' | i18n"
  ></nz-switch>
  <nz-select class="select" [(ngModel)]="column.value" [hidden]="!swAuditStatus[auditConfigType.Store]">
    <nz-option *ngFor="let number of stepRange" [nzLabel]="number" [nzValue]="number">
      {{ number }}
    </nz-option>
  </nz-select>
</ng-template>

<ng-template #tplTransRefund let-column="column">
  <nz-switch
    class="audit"
    [(ngModel)]="swAuditStatus[auditConfigType.TransRefund]"
    [nzCheckedChildren]="'GENERAL.INFO.SWITCH.ON' | i18n"
    [nzUnCheckedChildren]="'GENERAL.INFO.SWITCH.OFF' | i18n"
  ></nz-switch>
  <nz-select class="select" [(ngModel)]="column.value" [hidden]="!swAuditStatus[auditConfigType.TransRefund]">
    <nz-option *ngFor="let number of stepRange" [nzLabel]="number" [nzValue]="number">
      {{ number }}
    </nz-option>
  </nz-select>
</ng-template>

<ng-template #tradeOperate let-rowIndex="rowIndex">
  <app-rest-edit
    [editing]="isEdits[fields.AuditConfig][rowIndex]"
    (edit)="edit(fields.AuditConfig, rowIndex)"
    (cancel)="cancel()"
    (submit)="submit()"
    *ngIf="isShow"
  ></app-rest-edit>
</ng-template>
